<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>demo</title></title>
</head>
<body>
  <div id="root"></div>
  <script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>
  <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script>
  <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
  <script src="https://unpkg.com/prop-types@15.6/prop-types.js"></script>
  <script type="text/babel">

    class Person extends React.Component{
      // 生命周期
      state = {
        list: ["测试1","测试2","测试3","测试4"],
        isHot: true
      }
      
      render(){
        let renderHot
        if(this.state.isHot){
          renderHot= <h1>
            冷
          </h1>
        }else{
          renderHot= <h1>
            凉爽
          </h1>
        }

        return (
          <div>
            {
              renderHot
            }
            <ul>
            {
              this.state.list.map(el=>{
                return (
                  <li>{el}</li>
                )
              })
            }
            </ul>
          </div>
        )
      }
    }


    ReactDOM.render(<Person />,document.getElementById("root"))
  </script>
</body>
</html>